﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WqLunTan.Areas.Manage.Helper
{
    /// <summary>
    /// 日期扩展方法
    /// </summary>
    public static class DateTimeOffsetExtension
    {
        /// <summary>
        /// 获取本地时间
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="timezone"></param>
        /// <returns></returns>
        public static string ToLocalDateTimeString(this DateTimeOffset dt, int timezone = 8)
        {
            return dt.AddHours(8).ToString("yyyy-MM-dd HH:mm:ss");
        }
    }
}
